package com.ruoyi.activity.service.impl;

import java.util.List;

import com.ruoyi.activity.domain.vo.TbUserCouponVO;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.activity.mapper.TbUserCouponMapper;
import com.ruoyi.activity.domain.TbUserCoupon;
import com.ruoyi.activity.service.ITbUserCouponService;

/**
 * 用户领卷记录Service业务层处理
 * 
 * @author jll
 * @date 2025-06-13
 */
@Service
public class TbUserCouponServiceImpl implements ITbUserCouponService 
{
    @Autowired
    private TbUserCouponMapper tbUserCouponMapper;

    /**
     * 查询用户领卷记录
     * 
     * @param id 用户领卷记录主键
     * @return 用户领卷记录
     */
    @Override
    public TbUserCoupon selectTbUserCouponById(Long id)
    {
        return tbUserCouponMapper.selectTbUserCouponById(id);
    }

    /**
     * 查询用户领卷记录列表
     * 
     * @param tbUserCouponVO 用户领卷记录
     * @return 用户领卷记录
     */
    @Override
    public List<TbUserCouponVO> selectTbUserCouponList(TbUserCouponVO tbUserCouponVO)
    {
        return tbUserCouponMapper.selectTbUserCouponList(tbUserCouponVO);
    }

    /**
     * 新增用户领卷记录
     * 
     * @param tbUserCoupon 用户领卷记录
     * @return 结果
     */
    @Override
    public int insertTbUserCoupon(TbUserCoupon tbUserCoupon)
    {
        tbUserCoupon.setCreateTime(DateUtils.getNowDate());
        return tbUserCouponMapper.insertTbUserCoupon(tbUserCoupon);
    }

    /**
     * 修改用户领卷记录
     * 
     * @param tbUserCoupon 用户领卷记录
     * @return 结果
     */
    @Override
    public int updateTbUserCoupon(TbUserCoupon tbUserCoupon)
    {
        tbUserCoupon.setUpdateTime(DateUtils.getNowDate());
        return tbUserCouponMapper.updateTbUserCoupon(tbUserCoupon);
    }

    /**
     * 批量删除用户领卷记录
     * 
     * @param ids 需要删除的用户领卷记录主键
     * @return 结果
     */
    @Override
    public int deleteTbUserCouponByIds(Long[] ids)
    {
        return tbUserCouponMapper.deleteTbUserCouponByIds(ids);
    }

    /**
     * 删除用户领卷记录信息
     * 
     * @param id 用户领卷记录主键
     * @return 结果
     */
    @Override
    public int deleteTbUserCouponById(Long id)
    {
        return tbUserCouponMapper.deleteTbUserCouponById(id);
    }

    @Override
    public TbUserCoupon selectTbUserCouponByUserId(Long id) {
        return tbUserCouponMapper.selectTbUserCouponByUserId(id);
    }

    @Override
    public TbUserCoupon selectTbUserCouponByCouponCode(String couponCode) {
        return tbUserCouponMapper.selectTbUserCouponByCouponCode(couponCode);
    }
}
